home *** CD-ROM | disk | FTP | other *** search
/ Joystick Magazine 1996 May / cd joy 71No13.iso / pc / demos / eurosoc / source / netnow.txt < prev    next >
Text File  |  1995-07-24  |  40KB  |  1,781 lines

  1.  
  2.  
  3.  
  4. NetNOW! Technical Reference
  5.  
  6. Development System Document V1.0
  7.  
  8. Revision Date 
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. NetNOW! Development System
  29. © Copyright 1993-1995, All Rights Reserved
  30.  
  31. Human Machine Interfaces, Inc.
  32. 30 East Broadway, Suite 180
  33. Eugene, Oregon 97401
  34.  
  35. Tel: (503) 687-6509    Fax: (503) 687-6479    BBS: (503) 687-5623    EMail: hmi@efn.org
  36.  
  37. Forward
  38.  
  39. Human Machine Interfaces, Inc. strives to provide the development community with  high quality and high performance
  40. development systems allowing the developer to concentrate on producing top rate applications without having to worry
  41. about low level headaches such as sound support and network interfaces.
  42.  
  43. Human Machine Interfaces, Inc. flagship product, entitled ìSound Operating Systemî is in use by over 40 of the top
  44. entertainment companies and was showcased in over 60 games in the past year.  In a constant effort to increase the
  45. quality of our products we routinely conduct customer surveys to determine what aspect of our products needs the most 
  46. improvement.  Please feel free to contact Human Machine Interfaces, Inc. if you have any suggestions for product
  47. enhancement and/or improvement.
  48.  
  49. Human Machine Interfaces, Inc. provides full unlimited free technical support to all of our clients.  You will never
  50. be greeted by an answering machine or voice mail when calling for technical support.  In addition, when you receive
  51. a Human Machine Interfaces, Inc. development system, you will be assigned a personal technical support representative
  52. to assist you in integrating our systems quickly into your application.
  53.  
  54. We hope that you enjoy using our development systems as much as we have enjoyed developing them.
  55.  
  56.  
  57. Human Machine Interfaces, Inc.
  58. 30 East Broadway, Suite 180
  59. Eugene, Oregon  97401
  60.  
  61. Tel    : (503) 687-6509    Monday - Friday, 7:00am - 5:00pm Pacific Standard Time
  62. Fax        : (503) 687-6479
  63. BBS      : (503) 687-5623    28.8, 8, N, 1
  64. EMail    :  hmi@efn.org
  65.  
  66. Introduction
  67.  
  68. NetNOW! provides a transparent and high performance interface between the application program and the network layer 
  69. allowing you to create powerful multi-player applications.  The NetNOW! library supports both the IPX and NetBIOS network
  70. transfer protocols.  In addition, the NetNOW! library provides a simple interface to the Sound Operating System that
  71. allows voice to be transmitted in real-time over the network.
  72.  
  73. The following is an explanation of terms used throughout this manual to describe the NetNOW! system:
  74.  
  75. Broadcast
  76.  
  77. A ìbroadcastî means to send a message to all machines on a network.  Performing lots of broadcasts can slow down 
  78. the network.  The NetNOW! system only performs system wide broadcasts when trying to locate other nodes on the system.
  79.  
  80.  
  81. Console Node
  82.  
  83.  
  84. The ìconsole nodeî is the node that represents the local ( your ) computer.  It is important to know which node is 
  85. the local node so that the application does not use unnecessary system time sending messages to the local computer.
  86.  
  87.  
  88. Datagram
  89.  
  90.  
  91. A ìdatagramî is a term used to represent a chunk or packet of data that will be transferred across the network.  
  92. The term datagram is usually associated with the NetBIOS system.  In a typical NetBIOS environment, a datagram may 
  93. be up to 512 bytes in length.
  94.  
  95.  
  96. IPX
  97.  
  98.  
  99. IPX stands for the Internetwork Packet eXchange protocol used primarily by the Novell networking system.  An IPX 
  100. data packet may be up to 512 bytes in length.
  101.  
  102.  
  103. Node
  104.  
  105.  
  106. A ìnodeî is used to refer to an individual station on the network.  Each station on the network has is own unique 
  107. network address that is burned into the LAN card.
  108.  
  109.  
  110. NetBIOS
  111.  
  112.  
  113. NetBIOS is a network protocol used by system such as IBM PC LAN and Lantastic.  The Novell system can also support 
  114. NetBIOS but the IPX data transfer protocol is preferred as it is the native transfer protocol.
  115.  
  116. Packet or Data Packet
  117.  
  118.  
  119. A ìpacketî or ìdata packetî is simply a chunk of data that is to be transmitted across the network.  The packet can 
  120. contain any type of data and is usually preceded by a header to describe the data packet.
  121.  
  122.  
  123. Socket
  124.  
  125.  
  126. A ìsocketî is analogous to a file handle in DOS.  The IPX system uses sockets to communicate from node to node.
  127.  
  128.  
  129.  
  130. NetNOW! can transfer data packets directly to an individual node, to selected nodes, or to all machines on a network.  
  131. Typically the only time an application program should broadcast data packets to all machines on the network is during 
  132. the synchronization phase when there must be a predetermined number of participants to start the application.
  133.  
  134.  
  135. NetNOW! does not utilize ìsession basedî networking which requires significant system/network overhead, or use the 
  136. ìglobal broadcastî  method sending data packets to every station on the network during application execution.
  137.  
  138.  
  139. The following diagram demonstrates how the NetNOW! system interfaces with your application:
  140.  
  141.  
  142.  
  143.  
  144.  
  145. Application
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152. NetNOW!
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160. IPX/NetBIOS
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168. LAN Card
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177. The NetNOW! library automatically detects which system is currently operating.  If both IPX and NetBIOS are present, 
  178. IPX will be used.
  179.  
  180.  
  181. Multi-Player Programming Overview
  182.  
  183.  
  184. The following section is designed to give the application programmer a brief overview of multi-player programming 
  185. and some of the design issues that may accompany integration of the NetNOW! system.
  186.  
  187.  
  188. When designing a multi-player or client/server application it is essential that you transfer only the required information 
  189. from node to node to avoid slowing down the application and the network.  The first step is to decide what type of 
  190. information will need to be transferred to each node in the system.  Typically keyboard commands and player/world 
  191. movement information are the types of data that need to be transmitted.  Additionally if you are implementing real-time 
  192. voice communication, the voice data wil
  193.  
  194.  
  195. It is required that you include a small header with each data packet to help identify what type of packet the data 
  196. is and how the application should process it.  The NetNOW! system requires that the first 32 bits ( 4 bytes ) in 
  197. your header to be reserved and is used internally by the system for sequencing the packets as they are transmitted 
  198. across the network.  This sequencing is needed because the IPX and NetBIOS protocols do not guarantee that the data 
  199. packets are received in the order they are transmitt
  200.  
  201.  
  202. typedef    struct    _tagHEADER
  203.         
  204. {
  205.  
  206.             
  207. DWORD    dwSequence;    // sequence
  208.  
  209.             
  210. WORD        wType;        // block type
  211.             
  212. WORD        wPlayerNumber;    // which player?
  213.         
  214.         
  215. } HEADER;
  216.  
  217.  
  218. You may use any type of header that you require.  You should keep the number of elements in the header as small as 
  219. required as it reduces the size of the data that can be transmitted in the data packet.
  220.  
  221.  
  222. In a typical multi-player game situation, a data packet will be sent every frame to ensure that the machines stay 
  223. in synchronization with each other.  You may also wish to listen for ìbroadcastî packets so that new players may 
  224. join the application in real-time.
  225.  
  226.  
  227. The NetNOW! system keeps a sorted list of the node addresses so that a player may be identified by an ordinal number.  
  228. For example, if your node is number 3,  you will always be node 3 on each players machine.  This can be very important 
  229. if you wish to send messages to selective players on the network.  When a new player joins the application the list 
  230. is updated on each machine to keep everything in sync.
  231.  
  232.  
  233. NetNOW! System Architecture
  234.  
  235.  
  236. The NetNOW! system communicates with the IPX or NetBIOS system via interrupt calls executed through DPMI.  This technique 
  237. was utilized because both protocols require the data to be located in the first 1 megabyte of memory and to avoid 
  238. the real mode code calling up to the protected mode environment as data is transmitted and received.   The NetNOW! 
  239. system allocates a small chunk of real mode memory via DPMI to store the packet headers and packet data in while 
  240. the packets are in the process of being receive
  241.  
  242.  
  243.  
  244. Application
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251. NetNOW! Library
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258. IPX or NetBIOS NetNOW! Interface
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266. Real Mode Memory Area
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273. IPX or NetBIOS Network Layer
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280. LAN Card
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288. When data packets are sent from the application,  the packet data is copied down to the real mode memory area.  In 
  289. addition the NetNOW! system constructs the transmission header directly in the real mode memory area to avoid any 
  290. extra system overhead.  This also means that once a send request is issued the original packet data area in the application 
  291. memory is free to be used immediately.
  292.  
  293.  
  294. As the application program requests data from the NetNOW! system, the data is copied from the real mode memory area 
  295. to the destination memory address in the applications memory.  The real mode memory is then set up to receive data 
  296. immediately.
  297.  
  298.  
  299.  
  300. Function Reference
  301.  
  302.  
  303. The following section describes the various functions that are available for use in the NetNOW! development system.
  304.  
  305.  
  306.  
  307. System Initialization and Query
  308.  
  309.  
  310. The system initialization functions allow the application to initialize the network system and sync up with other 
  311. nodes on the network.  The query functions allow you to determine information about the NetNOW! system and the network 
  312. layer.
  313.  
  314.  
  315.  
  316. Function                Description                        
  317.  
  318.  
  319. hmiNETNOWInitSystem            Initializes NetNOW! system and detects network layer
  320.  
  321. hmiNETNOWUnInitSystem        Uninitializes the NetNOW! system and cancels all packets
  322.  
  323. hmiNETNOWGetNetworkAddr        Returns the network address of the console node
  324.  
  325. hmiNETNOWGetActiveNodes        Retrieves the number of active nodes on the NetNOW! system
  326.  
  327. hmiNETNOWGetConsoleNode        Returns which node is the console (local) node
  328.  
  329. hmiNETNOWGetNetworkType        Returns network type, i.e. IPX or NetBIOS
  330.  
  331. hmiNETNOWAddNode            Adds node (player) to the internal NetNOW! node list
  332.  
  333. hmiNETNOWSortNodes            Sorts the nodes into ascending order by network address
  334.  
  335. hmiNETNOWFindNodes            Attempts to locate nodes on the network
  336.  
  337. hmiNETNOWPostListen            Place a receive data command into the receive queue
  338.  
  339.  
  340.  
  341.  
  342. Data Transfer
  343.  
  344.  
  345. The data transfer functions allow the application to send and receive data from nodes on the network.
  346.  
  347.  
  348.  
  349. Function                Description                        
  350.  
  351.  
  352. hmiNETNOWSendData            Sends data to a node on the network
  353.  
  354. hmiNETNOWGetData            Receives data from a node on the network
  355.  
  356. hmiNETNOWGetHeader            Retrieve the header portion of a network data packet
  357.  
  358. hmiNETNOWGetBlock            Retrieve the data associated with a data header
  359.  
  360.  
  361. hmiNETNOWAddNode
  362.  
  363.     
  364. hmiNETNOWAddNode
  365.     
  366.  
  367. Description
  368.  
  369.  
  370.  
  371.  
  372.     
  373. Adds a new node to the internal system node list.
  374.  
  375.  
  376. #include "netnow.h"
  377.  
  378.  
  379. WORD    cdecl  hmiNETNOWAddNode( _NETNOW_NODE_ADDR sNode );
  380.  
  381.  
  382. sNode        Network address of node to add.
  383.     
  384.  
  385. Remarks
  386.     
  387. The hmiNETNOWAddNode function is used to add a new node to the internal system node list.  This is typically done 
  388. when a new player or node enters an already executing application.  After adding the node, you must call the hmiNETNOWSortNodes 
  389. function to re-order the internal node list.
  390.  
  391.  
  392. After adding a new node, your application should use the hmiNETNOWGetConsoleNode function to determine which node 
  393. represents your computer just in case the list was adjusted when the new node was added.
  394.  
  395.     
  396.  
  397. Return Value
  398.     
  399. The hmiNETNOWAddNode  function returns one of the following pre-defined error codes:
  400.  
  401.     
  402. _NETNOW_ADD_COMPLETE    Node was added to node list
  403.     
  404. _NETNOW_ADD_DUPLICATE    Node already in node list
  405.     
  406. _NETNOW_ADD_LIST_FULL    Node list is full
  407.  
  408.  
  409.     
  410.  
  411. See Also        
  412.  
  413.  
  414.  
  415.  
  416. hmiNETNOWFindNodes
  417.  
  418.     
  419. hmiNETNOWFindNodes
  420.     
  421.  
  422. Description
  423.  
  424.  
  425.  
  426.  
  427.     
  428. Attempts to locate a specific number of nodes on the network.
  429.  
  430.  
  431. #include "netnow.h"
  432.  
  433.  
  434. BOOL    cdecl  hmiNETNOWFindNodes( WORD wNodes );
  435.  
  436.  
  437. wNodes        Number of nodes to locate.
  438.     
  439.  
  440. Remarks
  441.     
  442. The hmiNETNOWFindNodes function is used to locate a specific number of nodes on the network.  This function will 
  443. not return until all nodes are located or a key is pressed.
  444.  
  445.  
  446. The function works by broadcasting out a special packet that contains the console node network address once a second.  
  447. Each station on the network using the hmiNETNOWFindNodes function does the same.  As each station receives a broadcast 
  448. packet, it adds the network address to the internal node list until the list has reached the desired number of nodes/players.
  449.  
  450.  
  451. You may wish to re-work the hmiNETNOWFindNodes function as is does use several C library functions such as kbhit, 
  452. time, cputs which you may wish to replace with your own functions.
  453.  
  454.     
  455.  
  456. Return Value
  457.     
  458. The hmiNETNOWFindNodes  function returns one of the following pre-defined error codes:
  459.  
  460.     
  461. _TRUE        All nodes were located.
  462.     
  463. _FALSE    A key was pressed to exit the location
  464.             
  465. process before all nodes were found.
  466.  
  467.  
  468.     
  469.  
  470. See Also        
  471.  
  472.  
  473.  
  474.  
  475. hmiNETNOWGetActiveNodes
  476.  
  477.     
  478. hmiNETNOWGetActiveNodes
  479.     
  480.  
  481. Description
  482.  
  483.  
  484.  
  485.  
  486.     
  487. Retrieves the number of active nodes on the NetNOW! system.
  488.  
  489.  
  490. #include "netnow.h"
  491.  
  492.  
  493. WORD    cdecl  hmiNETNOWGetActiveNodes( VOID );
  494.  
  495.     
  496.  
  497. Remarks
  498.     
  499. The hmiNETNOWGetActiveNodes function is useful for determining the number of active nodes on the system.  You may 
  500. wish to display information when new nodes are added, such as a system message to let other players know when a new 
  501. player enters the application.
  502.  
  503.     
  504.  
  505. Return Value
  506.     
  507. The hmiNETNOWGetActiveNodes  function returns the number of active nodes on the system.
  508.  
  509.  
  510. The function will always return at least one active node, because the console node is counted in the node list.
  511.  
  512.     
  513.  
  514. See Also        
  515.  
  516.  
  517.  
  518.  
  519. hmiNETNOWGetBlock
  520.  
  521.     
  522. hmiNETNOWGetBlock
  523.     
  524.  
  525. Description
  526.  
  527.  
  528.  
  529.  
  530.     
  531. Retrieves packet data for a specific node or system broadcast packets.  This function is used after calling the hmiNETNOWGetHeader 
  532. function.
  533.  
  534.  
  535. #include "netnow.h"
  536.  
  537.  
  538. VOID     cdecl  hmiNETNOWGetBlock(     PSTR     pPacket, 
  539.                     
  540. PSTR     pData, 
  541.                                
  542. WORD wDSize  );
  543.  
  544.  
  545. pPacket        Pointer to data packet returned by hmiNETNOWGetBlock.
  546.  
  547. pData        Pointer to application specific data area to move data to.
  548.  
  549. wDSize        Data packet size, in bytes.
  550.     
  551.  
  552. Remarks
  553.     
  554. The hmiNETNOWGetBlock function is used to retrieve data from the packet receive queue after retrieving the application 
  555. specific header with the hmiNETNOWGetHeader function.
  556.  
  557.  
  558. Note that if you wish to retrieve the data directly without going through the hmiNETNOWGetBlock function, you may 
  559. directly access the packet data via the pPacket variable as it points directly to the packet data.
  560.  
  561.  
  562. Be sure to issue a hmiNETNOWPostListen command after the data is retrieved.  If your application does not issue a 
  563. hmiNETNOWPostListen command after retrieving the data, the  receive queue will slowly run out of available elements 
  564. and could cause your application to lose incoming data packets.
  565.  
  566.     
  567.  
  568. Return Value
  569.     
  570. None
  571.  
  572.     
  573.     
  574.  
  575. See Also    hmiNETNOWGetData,  hmiNETNOWGetHeader    
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582. hmiNETNOWGetConsoleNode
  583.  
  584.     
  585. hmiNETNOWGetConsoleNode
  586.     
  587.  
  588. Description
  589.  
  590.  
  591.  
  592.  
  593.     
  594. Retrieves the node number of the console node.
  595.  
  596.  
  597. #include "netnow.h"
  598.  
  599.  
  600. WORD    cdecl  hmiNETNOWGetConsoleNode( VOID );
  601.  
  602.     
  603.  
  604. Remarks
  605.     
  606. The hmiNETNOWGetConsoleNode function is used to determine which node is the local computer on the network.  The application 
  607. should avoid sending messages to the console node because unnecessary system overhead will be used transmitting to 
  608. the local node.
  609.  
  610.     
  611.  
  612. Return Value
  613.     
  614. The hmiNETNOWGetConsoleNode  function returns the node number, 0 - number of active nodes, of  the computer the function 
  615. is executed on.
  616.  
  617.  
  618.     
  619.  
  620. See Also    hmiNETNOWGetActiveNodes    
  621.  
  622.  
  623.  
  624.  
  625.  
  626. hmiNETNOWGetData
  627.  
  628.     
  629. hmiNETNOWGetData
  630.     
  631.  
  632. Description
  633.  
  634.  
  635.  
  636.  
  637.     
  638. Retrieves packet data for a specific node or system broadcast packets.
  639.  
  640.  
  641. #include "netnow.h"
  642.  
  643.  
  644. BOOL    cdecl  hmiNETNOWGetData(     PSTR     pHeader, 
  645.                     
  646. WORD     wHSize,
  647.                              
  648. PSTR     pData,
  649.                     
  650. WORD     wDSize  );
  651.  
  652.  
  653. pHeader        Pointer to application specific header.
  654.  
  655. wHSize        Header size, in bytes.
  656.  
  657. pData        Pointer to application specific data.
  658.  
  659. wDSize        Data packet size, in bytes.
  660.     
  661.  
  662. Remarks
  663.     
  664. The hmiNETNOWGetData function is used to retrieve data from the packet receive queue.  The data packets are returned 
  665. to the application in the order that they are sent from the other nodes.   The system handles the packet ordering 
  666. automatically.
  667.  
  668.  
  669. Your application may wish to check periodically for broadcast packets so that additional players/nodes can enter 
  670. the application at run time.
  671.  
  672.  
  673. After each data packet is returned to the application, the packet is immediately available for data reception.
  674.     
  675.  
  676. Return Value
  677.     
  678. The hmiNETNOWGetData  function returns one of the following pre-defined error codes:
  679.  
  680.     
  681. _TRUE        Data was retrieved in sequence.
  682.     
  683. _FALSE    No data was waiting for the node.
  684.  
  685.  
  686.     
  687.  
  688. See Also    hmiNETNOWSendData    
  689.  
  690.  
  691.  
  692.  
  693. hmiNETNOWGetHeader
  694.  
  695.     
  696. hmiNETNOWGetHeader
  697.     
  698.  
  699. Description
  700.  
  701.  
  702.  
  703.  
  704.     
  705. Retrieves application specific data header for a specific node or system broadcast packets.
  706.  
  707.  
  708. #include "netnow.h"
  709.  
  710.  
  711. BOOL    cdecl  hmiNETNOWGetHeader(    PSTR     pHeader, 
  712.                     
  713. WORD     wHSize,
  714.                     
  715. PSTR *  pPacket  );
  716.  
  717.  
  718. pHeader        Pointer to application specific header.
  719.  
  720. wHSize        Header size, in bytes.
  721.  
  722. pPacket        Pointer to pointer for application specific data.  This pointer will be
  723.         
  724. passed to the hmiNETNOWGetBlock function.
  725.     
  726.  
  727. Remarks
  728.     
  729. The hmiNETNOWGetHeader function is used to retrieve only the data header from the packet receive queue.  If you wish 
  730. to retrieve the actual data that accompanies the header, you must use the hmiNETNOWGetBlock function.  This function 
  731. is useful when applications transfer many different types of data packets.  By retrieving just the header your application 
  732. can direct the call to hmiNETNOWGetBlock to point to the correct data area in which to place the data packet and 
  733. avoid having to buffer the packet data i
  734.  
  735.  
  736. The data packets are returned to the application in the order that they are sent from the other nodes.   The system 
  737. handles the packet ordering automatically.
  738.  
  739.  
  740. The application may wish to check periodically for broadcast packets so that additional players/nodes can enter the 
  741. application in real time.
  742.  
  743.  
  744. After each data packet is returned to the application, the packet is immediately available for data reception.
  745.     
  746.  
  747. Return Value
  748.     
  749. The hmiNETNOWGetHeader  function returns one of the following pre-defined error codes:
  750.  
  751.     
  752. _TRUE        Data was retrieved in sequence.
  753.     
  754. _FALSE    No data was waiting for the node.
  755.  
  756.  
  757.     
  758.  
  759. See Also    hmiNETNOWGetData, hmiNETNOWGetBlock    
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766. hmiNETNOWGetNetworkAddr
  767.  
  768.     
  769. hmiNETNOWGetNetworkAddr
  770.     
  771.  
  772. Description
  773.  
  774.  
  775.  
  776.  
  777.     
  778. Retrieves the network address of the console node.
  779.  
  780.  
  781. #include "netnow.h"
  782.  
  783.  
  784. BOOL    cdecl  hmiNETNOWGetNetworkAddr( _NETNOW_NODE_ADDR *                         sNodeAddr  
  785. );
  786.  
  787.  
  788. sNodeAddr    Pointer to a node address variable.
  789.  
  790.     
  791.  
  792. Remarks
  793.     
  794. The hmiNETNOWGetNetworkAddr function is used to determine the address of the console node.  This function is used 
  795. if you wish to transmit your network address to another node on the system.
  796.  
  797.  
  798. The application may wish to send the local network address out when trying to enter an already executing application.
  799.  
  800.     
  801.  
  802. Return Value
  803.     
  804. The hmiNETNOWGetNetworkAddr  function returns one of the following pre-defined error codes:
  805.  
  806.     
  807. _TRUE        The network address was retrieved
  808.     
  809. _FALSE    The network address was not retrieved
  810.  
  811.  
  812.     
  813.  
  814. See Also    hmiNETNOWGetConsoleNode, hmiNETNOWGetActiveNodes    
  815.  
  816.  
  817.  
  818.  
  819. hmiNETNOWGetNetworkType
  820.  
  821.     
  822. hmiNETNOWGetNetworkType
  823.     
  824.  
  825. Description
  826.  
  827.  
  828.  
  829.  
  830.     
  831. Retrieves the network type of the console node.
  832.  
  833.  
  834. #include "netnow.h"
  835.  
  836.  
  837. WORD    cdecl  hmiNETNOWGetNetworkType( VOID  );
  838.  
  839.     
  840.  
  841. Remarks
  842.     
  843. The hmiNETNOWGetNetworkType function is used to determine the current network protocol that the NetNOW! system is 
  844. using to transfer information.  This function is primarily used for information purposes only.
  845.  
  846.  
  847.     
  848.  
  849. Return Value
  850.     
  851. The hmiNETNOWGetNetworkType  function returns one of the following values:
  852.  
  853.     
  854. _NETNOW_IPX        IPX protocol based network
  855.     
  856. _NETNOW_NETBIOS    NetBIOS protocol based network
  857.  
  858.  
  859.     
  860.  
  861. See Also    hmiNETNOWGetNetworkAddr    
  862.  
  863.  
  864.  
  865. hmiNETNOWInitSystem
  866.  
  867.     
  868. hmiNETNOWInitSystem
  869.     
  870.  
  871. Description
  872.  
  873.  
  874.  
  875.  
  876.     
  877. Initialize the NetNOW! system and determine if a network layer is present.
  878.  
  879.  
  880. #include "netnow.h"
  881.  
  882.  
  883. WORD    cdecl  hmiNETNOWInitSystem( WORD wMaxNodes  );
  884.  
  885.  
  886. wMaxNodes    Maximum number of allowable nodes/players.
  887.  
  888.     
  889.  
  890. Remarks
  891.     
  892. The hmiNETNOWInitSystem function must be called before calling any other NetNOW! functions.  This function determines 
  893. the type of network protocol, if any, is present.  The application may determine what type of network protocol the 
  894. NetNOW! system is using by calling the hmiNETNOWGetNetworkType function.
  895.  
  896.  
  897. Note that on NetBIOS systems, the hmiNETNOWInitSystem function may take a few seconds to initialize as the NetBIOS 
  898. system is slower because of the need to query other nodes when initializing.  The IPX system will initialize in a 
  899. very short period of time.
  900.  
  901.  
  902.     
  903.  
  904. Return Value
  905.     
  906. The hmiNETNOWInitSystem  function returns one of the following pre-defined error codes:
  907.  
  908.     
  909. _NETNOW_NO_ERROR        NetNOW! system initialized 
  910.     
  911. _NETNOW_NO_NETWORK    No network was located
  912.     
  913. _NETNOW_INIT_ERROR    An init error occurred
  914.     
  915. _NETNOW_NO_REALMEM    No free real mode memory
  916.  
  917.  
  918.     
  919.  
  920. See Also    hmiNETNOWUnInitSystem    
  921.  
  922.  
  923.  
  924.  
  925. hmiNETNOWPostListen
  926.  
  927.     
  928. hmiNETNOWPostListen
  929.     
  930.  
  931. Description
  932.  
  933.  
  934.  
  935.  
  936.     
  937. Places a listen for data command in the network receive queue.
  938.  
  939.  
  940. #include "netnow.h"
  941.  
  942.  
  943. BOOL    cdecl  hmiNETNOWPostListen(  VOID  );
  944.  
  945.  
  946.     
  947.  
  948. Remarks
  949.     
  950. The hmiNETNOWPostListen function is used to place a ìlisten for dataî command into the data receive queue.  This 
  951. function should be used if you choose not to use the NetNOW! function hmiNETNOWGetBlock when transferring data from 
  952. the receive area to your program data area.   After you retrieve the data block, simply call this function to make 
  953. the slot available to receive data again.
  954.  
  955.     
  956.  
  957. Return Value
  958.     
  959. The hmiNETNOWPostListen  function returns one of the following pre-defined error codes:
  960.  
  961.     
  962. _TRUE        The listen command was issued
  963.     
  964. _FALSE    The receive data queue was full
  965.  
  966.  
  967.     
  968.  
  969. See Also    hmiNETNOWGetHeader    
  970.  
  971.  
  972.  
  973.  
  974.  
  975. hmiNETNOWSendData
  976.  
  977.     
  978. hmiNETNOWSendData
  979.     
  980.  
  981. Description
  982.  
  983.  
  984.  
  985.  
  986.     
  987. Sends data packet to a specific node or to the entire network.
  988.  
  989.  
  990. #include "netnow.h"
  991.  
  992.  
  993. BOOL    cdecl  hmiNETNOWSendData(     PSTR     pHeader, 
  994.                     
  995. WORD     wHSize,
  996.                                
  997. PSTR     pData,
  998.                     
  999. WORD     wDSize,
  1000.                                
  1001. WORD     wNode  );
  1002.  
  1003.  
  1004. pHeader        Pointer to application specific header.
  1005.  
  1006. wHSize        Header size, in bytes.
  1007.  
  1008. pData        Pointer to application specific data.
  1009.  
  1010. wDSize        Data packet size, in bytes.
  1011.  
  1012. wNode        Node to send data to, _NETNOW_BROADCAST for system             broadcast.
  1013.     
  1014.  
  1015. Remarks
  1016.     
  1017. The hmiNETNOWSendData function is used to send data to the packet transmission queue.  The data packets are transmitted 
  1018. to the application in the order that they are received from the application.   The system handles the packet ordering 
  1019. automatically.
  1020.  
  1021.     
  1022.  
  1023. Return Value
  1024.     
  1025. The hmiNETNOWSendData  function returns one of the following pre-defined error codes:
  1026.  
  1027.     
  1028. _TRUE        Data sent to the transmission queue.
  1029.     
  1030. _FALSE    The transmission queue was full.
  1031.  
  1032.  
  1033.     
  1034.  
  1035. See Also    hmiNETNOWGetData    
  1036.  
  1037.  
  1038.  
  1039.  
  1040. hmiNETNOWSortNodes
  1041.  
  1042.     
  1043. hmiNETNOWSortNodes
  1044.     
  1045.  
  1046. Description
  1047.  
  1048.  
  1049.  
  1050.  
  1051.     
  1052. Sorts the internal node list in ascending order by network address.
  1053.  
  1054.  
  1055. #include "netnow.h"
  1056.  
  1057.  
  1058. VOID    cdecl  hmiNETNOWSortNodes( VOID );
  1059.     
  1060.  
  1061. Remarks
  1062.     
  1063. The hmiNETNOWSortNodes function must be called after adding a new node using the hmiNETNOWAddNode function in order 
  1064. to maintain the internal node list.
  1065.  
  1066.     
  1067.  
  1068. Return Value
  1069.     
  1070. None
  1071.  
  1072.     
  1073.  
  1074. See Also    hmiNETNOWAddNode    
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080. hmiNETNOWUnInitSystem
  1081.  
  1082.     
  1083. hmiNETNOWUnInitSystem
  1084.     
  1085.  
  1086. Description
  1087.  
  1088.  
  1089.  
  1090.  
  1091.     
  1092. Uninitializes the NetNOW! system and cancels all remaining receive and transmission packets.  Real mode memory is 
  1093. also freed by this function.
  1094.  
  1095.  
  1096. #include "netnow.h"
  1097.  
  1098.  
  1099. BOOL    cdecl  hmiNETNOWUnInitSystem( VOID );
  1100.     
  1101.  
  1102. Remarks
  1103.     
  1104. The hmiNETNOWUnInitSystem function must be called before terminating your application.  If this function is not called, 
  1105. real mode memory may be overwritten if any data packets arrive after the application terminates.
  1106.  
  1107.     
  1108.  
  1109. Return Value
  1110.     
  1111. The hmiNETNOWUnInitSystem  function returns one of the following pre-defined error codes:
  1112.  
  1113.     
  1114. _TRUE        The system was uninitialized.
  1115.     
  1116. _FALSE    The system was not initialized.
  1117.  
  1118.  
  1119.     
  1120.  
  1121. See Also    hmiNETNOWInitSystem    
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127. Data Structures / System Definitions
  1128.  
  1129.  
  1130. The following section describes the various data structures and system defines that are used by the NetNOW! system.  
  1131. All of the data structures are located in the netnow.h header file.
  1132.  
  1133.  
  1134. The number to the right of the definition in parenthesis is the default value for the definition.
  1135.  
  1136.  
  1137. Definition
  1138.  
  1139.     
  1140. _NETNOW_MAX_NODES                ( 16 )
  1141.  
  1142.  
  1143. Description
  1144.  
  1145.  
  1146. This value indicates the maximum number of network nodes that can be active at any one time.  If you alter this value 
  1147. you must recompile the NetNOW! library as this affects the amount of memory that is allocated inside the IPX and 
  1148. NetBIOS drivers.
  1149.  
  1150.  
  1151.  
  1152. Definition
  1153.  
  1154.  
  1155. _NETNOW_MAX_SEND_PACKETS            ( 16 )
  1156.  
  1157.  
  1158. Description
  1159.  
  1160.  
  1161. This value sets the maximum number of packets that will be allocated in real mode memory for the transmission queue.  
  1162. If you are sending out a large number of packets each frame you may wish to increase this value.  If you alter this 
  1163. value you must recompile the NetNOW! libraries.
  1164.  
  1165.  
  1166.  
  1167. Definition
  1168.  
  1169.  
  1170. _NETNOW_MAX_LISTEN_PACKETS        ( 16 )
  1171.  
  1172.  
  1173. Description
  1174.  
  1175.  
  1176. This value sets the maximum number of packets that will be allocated in real mode memory for the receive queue.  
  1177. If you are allowing more than 8 nodes active at one time you may wish to increase this value.  If you alter this 
  1178. value you must recompile the NetNOW! libraries.
  1179.  
  1180.  
  1181. Definition
  1182.  
  1183.  
  1184. _NETNOW_DATA_PACKET                ( 512 )
  1185.  
  1186.  
  1187. Description
  1188.  
  1189.  
  1190. This value sets the maximum size of a data packet that can be transmitted via the NetNOW! system.  This value cannot 
  1191. be larger than 512 bytes.  If your application is transmitting small packets, you may wish to decrease this value 
  1192. as it lowers the amount of real mode memory allocated by the system.  If you alter this value you must recompile 
  1193. the NetNOW! libraries.
  1194.  
  1195.  
  1196.  
  1197.  
  1198. System Data Structures
  1199.  
  1200.  
  1201.  
  1202. The following data structure is used to hold the network address when adding and deleting nodes from the system.  
  1203. You may find out the network address of your machine by using the hmiNETNOWGetNetworkAddr  function.
  1204.  
  1205.  
  1206. typedef    union
  1207.  
  1208.         
  1209. {
  1210.  
  1211.             
  1212. _IPX_LOCAL_TARGET        sIPX;
  1213.             
  1214. _NETBIOS_LOCAL_TARGET    sNETBIOS;
  1215.  
  1216.         
  1217. } _NETNOW_NODE_ADDR;
  1218.  
  1219.  
  1220.  
  1221. Structure Element Description
  1222.  
  1223.  
  1224. sIPX
  1225.  
  1226.  
  1227. This element contains the IPX specific node address.  It consists of the local target address as well as the Internetwork 
  1228. address including bridge information.
  1229.  
  1230.  
  1231.  
  1232. sNETBIOS
  1233.  
  1234.  
  1235. This element contains the NetBIOS specific node address.  It is derived from the node address that is burned into 
  1236. each LAN card with 10 trailing spaces to form a complete NetBIOS network name.
  1237.  
  1238. Example Program
  1239.  
  1240.  
  1241. The following example program demonstrates how to initialize the NetNOW! system, locate other nodes on the network, 
  1242. and send and receive messages between computers.
  1243.  
  1244.  
  1245. /****************************************************************************
  1246.  
  1247. *
  1248.  
  1249. *  File              : test.c
  1250.  
  1251. *  Date Created      : 1/3/95
  1252.  
  1253. *  Description       : test program for the ipx driver
  1254.  
  1255. *
  1256.  
  1257. *  Programmer(s)     : Nick Skrepetos
  1258.  
  1259. *  Last Modification : 2/2/95 - 10:3:15 AM
  1260.  
  1261. *  Additional Notes  :
  1262.  
  1263. *
  1264.  
  1265. *****************************************************************************
  1266.  
  1267. *            Copyright (c) 1994,  HMI, Inc.  All Rights Reserved            *
  1268.  
  1269. ****************************************************************************/
  1270.  
  1271.  
  1272. #include <stdio.h>
  1273.  
  1274. #include <stdlib.h>
  1275.  
  1276. #include <string.h>
  1277.  
  1278. #include "hmistd.h"
  1279.  
  1280. #include "netnow.h"
  1281.  
  1282. #include "vdata.h"
  1283.  
  1284. #include "vchat.h"
  1285.  
  1286.  
  1287. // local functions
  1288.  
  1289. VOID    hmiNetworkDemo          ( VOID );
  1290.  
  1291.  
  1292. /****************************************************************************
  1293.  
  1294. *
  1295.  
  1296. *  Syntax
  1297.  
  1298. *
  1299.  
  1300. *     VOID    main( WORD wArgc, PSTR szArgv[] )
  1301.  
  1302. *
  1303.  
  1304. *  Description
  1305.  
  1306. *
  1307.  
  1308. *        main function for testing ipx drivers
  1309.  
  1310. *
  1311.  
  1312. *  Parameters
  1313.  
  1314. *
  1315.  
  1316. *        Type           Description
  1317.  
  1318. *        --------------------------
  1319.  
  1320. *        wArgc          Argument count
  1321.  
  1322. *        szArgv         Arguments
  1323.  
  1324. *
  1325.  
  1326. *  Return
  1327.  
  1328. *
  1329.  
  1330. *     nothing
  1331.  
  1332. *
  1333.  
  1334. ****************************************************************************/
  1335.  
  1336. VOID    main( WORD wArgc, PSTR szArgv[] )
  1337.     
  1338. {
  1339.  
  1340.  
  1341. The function hmiVCHATInit  reads the ënetnow.inií configuration file to retrieve settings describing the voice chat 
  1342. system and the number of nodes the application would like to have participate.  It is not required that you call 
  1343. this function, it is provided simply to externalize some of the network parameters.
  1344.  
  1345.       
  1346. // read the .ini file
  1347.       
  1348. if ( !hmiVCHATInit() )
  1349.       
  1350. {
  1351.          
  1352. // print error
  1353.          
  1354. printf( "ERROR: Could not read NETNOW.INI\n" );
  1355.  
  1356.          
  1357. // exit
  1358.          
  1359. exit( 1 );
  1360.       
  1361. }
  1362.  
  1363.       
  1364. // display message
  1365.       
  1366. printf( "NetNOW! system initialization started.\n" );
  1367.  
  1368.  
  1369.  
  1370. The hmiNETNOWInitSystem function attempts to locate what type of network is present in the system.   The value of 
  1371. ë8í is being passed to this function to indicate that the maximum number of nodes to be supported is 8.  This value 
  1372. may be any value up to the value defined in netnow.h by the _NETNOW_MAX_NODES equate.
  1373.  
  1374.       
  1375. // check if NetNOW! is present
  1376.       
  1377. if ( hmiNETNOWInitSystem( 8 ) != _NETNOW_NO_ERROR )
  1378.       
  1379. {
  1380.          
  1381. // print error
  1382.          
  1383. printf( "ERROR: NetNOW! could not locate IPX or NetBIOS!\n" );
  1384.  
  1385.          
  1386. // error
  1387.          
  1388. exit( 1 );
  1389.       
  1390. }
  1391.  
  1392.       
  1393. // display
  1394.       
  1395. printf( "\nNetNOW! system initialized!\n\n" );
  1396.  
  1397.  
  1398.  
  1399.  
  1400. The hmiNETNOWGetNetworkType function queries the NetNOW! system to determine what type of network is running.   It 
  1401. is not required that the application call this function, it is used here only for demonstration and debugging purposes.
  1402.  
  1403.       
  1404. // check for information display
  1405.       
  1406. if ( wNETInfoFlag )
  1407.          
  1408. switch( hmiNETNOWGetNetworkType() )
  1409.          
  1410. {
  1411.             
  1412. case  _NETNOW_IPX    :
  1413.                                     
  1414. // display type
  1415.                                     
  1416. printf( "Network is using a IPX based protocol.\n" );
  1417.                                     
  1418. break;
  1419.             
  1420. case  _NETNOW_NETBIOS:
  1421.                                     
  1422. // display type
  1423.                                     
  1424. printf( "Network is using a NetBIOS based protocol.\n" );
  1425.                                     
  1426. break;
  1427.          
  1428. }
  1429.  
  1430.  
  1431.  
  1432. The hmiNETNOWFindNodes function attempts to locate the other nodes on the system.  The ëwNETNodesí variable is filled 
  1433. in by the hmiVCHATInit function and indicates the number of nodes the system should locate before proceeding.
  1434.  
  1435.       
  1436. // find nodes
  1437.       
  1438. printf( "\nAttempting to Locate %d Nodes.\n", wNETNodes );
  1439.  
  1440.       
  1441. // find the requested nodes
  1442.       
  1443. if ( hmiNETNOWFindNodes( wNETNodes ) )
  1444.          
  1445. printf( "\n\nLocated all requested nodes!\n" );
  1446.       
  1447. else
  1448.       
  1449. {
  1450.          
  1451. printf( "\n\nERROR: could not locate the requested nodes.\n" );
  1452.       
  1453. }
  1454.  
  1455.  
  1456.  
  1457. At this point, all nodes should have been located.   The application should query the number of active nodes to check 
  1458. if all of the nodes were located.  The hmiNETNOWGetActiveNodes function returns the number of nodes in the internal 
  1459. node list.
  1460.  
  1461.       
  1462. // network demo
  1463.       
  1464. if ( hmiNETNOWGetActiveNodes() > 1 )
  1465.          
  1466. hmiNetworkDemo();
  1467.  
  1468.  
  1469.  
  1470. The NetNOW! function hmiNETNOWUnInitSystem should always be called before exiting the application to insure that 
  1471. all pending network events have been canceled.
  1472.  
  1473.       
  1474. // uninit system
  1475.       
  1476. hmiNETNOWUnInitSystem();
  1477.     
  1478. }
  1479.  
  1480.  
  1481.  
  1482.  
  1483. The following function demonstrates sending network data messages to another node and receiving messages from a remote 
  1484. node.
  1485.  
  1486.  
  1487. /****************************************************************************
  1488.  
  1489. *
  1490.  
  1491. *  Syntax
  1492.  
  1493. *
  1494.  
  1495. *     VOID    hmiNetworkDemo( VOID )
  1496.  
  1497. *
  1498.  
  1499. *  Description
  1500.  
  1501. *
  1502.  
  1503. *     simple example of sending messages from one machine to another
  1504.  
  1505. *
  1506.  
  1507. *  Parameters
  1508.  
  1509. *
  1510.  
  1511. *     none
  1512.  
  1513. *
  1514.  
  1515. *  Return
  1516.  
  1517. *
  1518.  
  1519. *     nothing
  1520.  
  1521. *
  1522.  
  1523. ****************************************************************************/
  1524.  
  1525. VOID    hmiNetworkDemo( VOID )
  1526.  
  1527. {
  1528.       
  1529. WORD                 wExitFlag;
  1530.       
  1531. PSTR                 pPacket;
  1532.       
  1533. WORD                 wActiveNodes;
  1534.       
  1535. WORD                 wConsoleNode;
  1536.       
  1537. _XFER_BLOCK_HEADER   sBlock;
  1538.       
  1539. BYTE                 szMessage[ 128 ];
  1540.  
  1541.       
  1542. // initialize exit flag
  1543.       
  1544. wExitFlag      =  _FALSE;
  1545.  
  1546.  
  1547.  
  1548. At this point, the code retrieves the number of active nodes simply to display the information to the user indicating 
  1549. the number of nodes active.
  1550.  
  1551.       
  1552. // get active nodes
  1553.       
  1554. wActiveNodes   =  hmiNETNOWGetActiveNodes();
  1555.  
  1556.  
  1557.  
  1558. The application should always call the hmiNETNOWGetConsoleNode function to retrieve the local node number to avoid 
  1559. sending messages to the local computer and thus wasting valuable CPU time.
  1560.  
  1561.       
  1562. // get console node
  1563.       
  1564. wConsoleNode   =  hmiNETNOWGetConsoleNode();
  1565.  
  1566.       
  1567. // display banner
  1568.       
  1569. printf( "\n\n*********  NetNOW! Demonstration *********\n\n" );
  1570.  
  1571.       
  1572. // display console node
  1573.       
  1574. printf( "Number of Active Nodes       : %d\n", wActiveNodes );
  1575.       
  1576. printf( "Node Number of this Computer : %d\n", wConsoleNode );
  1577.  
  1578.       
  1579. // display message
  1580.       
  1581. printf( "\n(S)end to station, (Q)uit\n" );
  1582.  
  1583.       
  1584. // wait for exit flag
  1585.       
  1586. while( !wExitFlag )
  1587.       
  1588. {
  1589.  
  1590.  
  1591.  
  1592. The application now queries the system to determine if a data packet has arrived.  The hmiNETNOWGetHeader function 
  1593. does not retrieve the actual data at this point, just the application specific header.   The program may then examine 
  1594. the data header to determine what type of data packet it is.  If the application is only utilizing one type of data 
  1595. packet, the hmiNETNOWGetData function may be used instead as it retrieves the header and data packet in one function 
  1596. call.
  1597.  
  1598.          
  1599. // check if we have data
  1600.          
  1601. if ( hmiNETNOWGetHeader( (PSTR)&sBlock, sizeof( _XFER_BLOCK_HEADER ), 
  1602.                     
  1603. &pPacket ) )
  1604.          
  1605. {
  1606.  
  1607.  
  1608.  
  1609. At this point, the application has retrieved a data packet header.   In our example transfer header, the data block 
  1610. type is stored in the ëwTypeí element of the header.
  1611.  
  1612.             
  1613. // check header type
  1614.             
  1615. switch( sBlock.wType )
  1616.             
  1617. {
  1618.  
  1619.  
  1620.  
  1621. If the data block type is a data block, the application can retrieve the actual packet data by calling the hmiNETNOWGetBlock 
  1622. function.
  1623.  
  1624.                
  1625. case  _XFER_BLOCK_DATA  :
  1626.                                           
  1627. // get data block
  1628.                                           
  1629. hmiNETNOWGetBlock( pPacket, szMessage,sBlock.wLength );
  1630.  
  1631.                                           
  1632. // print message
  1633.                                           
  1634. printf( "%s\n", szMessage );
  1635.                                           
  1636. break;
  1637.  
  1638.  
  1639.  
  1640. The application must post a listen command if the data packet is not retrieved so that the system can reuse the data 
  1641. packet slot in the receive queue.   If  the application does not issue the hmiNETNOWPostListen command, the receive 
  1642. queue may not be able to receive any more data packets.   The listen command need only be issued if the data block 
  1643. is not retrieved via the hmiNETNOWGetBlock or hmiNETNOWGetData functions.
  1644.  
  1645.                 
  1646. default      :
  1647.                          
  1648. // post listen
  1649.                                           
  1650. hmiNETNOWPostListen();
  1651.                          
  1652. break;
  1653.  
  1654.             
  1655. }
  1656.  
  1657.       
  1658. }
  1659.  
  1660.          
  1661. // check for key press
  1662.          
  1663. if ( kbhit() )
  1664.             
  1665. switch( tolower( getch() ) )
  1666.             
  1667. {
  1668.  
  1669.  
  1670.  
  1671. In this example the application sets up the transfer header type as a data block, retrieves the message to be transmitted 
  1672. and sets the length of the data block in the application specific header.
  1673.  
  1674.                
  1675. case  's'   :
  1676.                               
  1677. // set up header type
  1678.                               
  1679. sBlock.wType   =  _XFER_BLOCK_DATA;
  1680.  
  1681.                               
  1682. // display
  1683.                               
  1684. printf( "Enter Message : \n" );
  1685.  
  1686.                               
  1687. // get message
  1688.                               
  1689. gets( szMessage );
  1690.  
  1691.                               
  1692. // set block length
  1693.                               
  1694. sBlock.wLength =  strlen( szMessage ) + 1;
  1695.  
  1696.  
  1697.  
  1698. The application may now send out the data packet to the data send queue.  The application should check to make sure 
  1699. that the data packet was sent to the data send queue.  The hmiNETNOWSendData function will return ë_TRUEí when the 
  1700. data has been sent.  The only time the function will return ë_FALSEí is when the send queue is full and data packets 
  1701. are waiting to be sent out.
  1702.  
  1703.                               
  1704. // send data
  1705.                               
  1706. while( !hmiNETNOWSendData( (PSTR)&sBlock, 
  1707.                     
  1708. sizeof( _XFER_BLOCK_HEADER ), (PSTR)szMessage,
  1709.                                       
  1710. sBlock.wLength, wConsoleNode ^ 0x01 ) );
  1711.                               
  1712. break;
  1713.                
  1714. case  0x1b  :
  1715.                
  1716. case  'q'   :
  1717.                               
  1718. // set exit flag
  1719.                               
  1720. wExitFlag   =  _TRUE;
  1721.                               
  1722. break;
  1723.             
  1724. }
  1725.       
  1726. }
  1727.  
  1728. }
  1729.  
  1730.  
  1731.  
  1732. Common Questions
  1733.  
  1734.  
  1735. The following section contains many common questions accompanied by the answers to those questions.
  1736.  
  1737.  
  1738.   
  1739. How do I know what type of network protocol my network is using?
  1740.  
  1741.  
  1742. With the NetNOW! system you do not need to know what protocol your network is using as the system automatically detects 
  1743. the presence of both IPX and NetBIOS.  Your application may query the NetNOW! system with the hmiNETNOWGetNetworkType 
  1744. function to determine what type of network you are using.
  1745.  
  1746.  
  1747.   
  1748. Is there a limit to the number of nodes that can be active at one time?
  1749.  
  1750.  
  1751. The maximum number of nodes that can be active at any one time is defined in the netnow.h header file and by the 
  1752. number you pass into the hmiNETNOWInitSystem function when you initialize the system.  The NetNOW! system, as shipped, 
  1753. can accommodate up to 16 players/nodes at one time.  If you wish to increase this limit, you must change the _NETNOW_MAX_NODES 
  1754. define in the netnow.h header file and recompile the NetNOW! library.  Note that increasing this limit will use more 
  1755. real mode memory.
  1756.  
  1757.  
  1758.   
  1759. What is the maximum size of a data packet that can be received or transmitted?
  1760.  
  1761.  
  1762. The maximum size of a data packet for the NetNOW! system is 512 bytes including the packet header.  This limit is 
  1763. imposed because of the IPX and NetBIOS Datagram protocols.
  1764.  
  1765.  
  1766.   
  1767. Why does the system have to allocate real mode memory?
  1768.  
  1769.  
  1770. Both the IPX and NetBIOS system are designed to handle memory addressing within the first megabyte of memory therefor 
  1771. all data structures and packet data must be copied down into the real mode memory so that the IPX/NetBIOS system 
  1772. can access it.
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.